Hi Ray,
You cannot leave the LVTTL UART input floating and expect a predicable result. You might connect the input to the output as a loopback for testing. You can check on the Digital IO screen how the IO is configured. Regards TK
Group: DynoMotion |
Message: 5208 |
From: himykabibble |
Date: 6/14/2012 |
Subject: Re: RS232 Not Working? |
Tom,
Why are the inputs so sensitive? I've noticed many times that if I change one input while watching the Digital I/O dialog, it is not unusual to see several inputs flash briefly to a different state. I thought most of the inputs had pull-downs on them?
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
>
> You cannot leave the LVTTL UART input floating and expect a predicable result.
> You might connect the input to the output as a loopback for testing.
>
> You can check on the Digital IO screen how the IO is configured.
>
> Regards
> TK
>
>
>
> ________________________________
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Wednesday, June 13, 2012 11:56 PM
> Subject: [DynoMotion] Re: RS232 Not Working?
>
>
> Â
> FWIW - I tried the poll-driven code from the RS232 web page, and got exactly the same result....
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> >
> > Tom,
> >
> > I've got my pendant firmware mostly up, and just tried to use the KFlop RS232 for the first time. I'm using the BufferedRS232 example code, with only the BAUD rate changed to 9600, a while(1) loop added around the existing while loop and RS232_GetChar call, and a printf to print the received character. Trouble is, it spews characters continuously, even though there is nothing even connected to the RS232 data pins! Are you sure this works?
> >
> > Does the EnableRS232Cmds call set the pin directions, or do I need to do that?
> >
> > Regards,
> > Ray L.
> >
>
|
|
Group: DynoMotion |
Message: 5209 |
From: Tom Kerekes |
Date: 6/14/2012 |
Subject: Re: RS232 Not Working? |
Hi Ray,
Most of the IO do not have pull down resistors. Pull down resistors would interfere with the open-collector output mode. There are 16 IO with strong 150ohm pull downs. The first 8 on JP4 and JP6. The Inputs are MosFETS which are very high impedance (multi-meg ohms). To be used as an input they must be driven high and low by something. If left undriven they will float to any level and can be influenced by the slightest signal such as the parasitic capacitance to a nearby signal.
Regards TK
Group: DynoMotion |
Message: 5210 |
From: himykabibble |
Date: 6/14/2012 |
Subject: Re: RS232 Not Working? |
Tom,
Still no dice. I hard-wired JP7-5 to JP7-6. No other I/Os have anything connected. I run the following program, and it prints the correct values for the sent data, and always zero for the received data. I'm stuck....
Regards,
Ray L.
#include "KMotionDef.h"
void ReceiveChar()
{
// wait for data in buffer
while ((FPGA(RS232_STATUS) & RS232_DATA_READY)==0)
;
return FPGA(RS232_DATA);
}
void SendChar(char c)
{
while (FPGA(RS232_STATUS) & RS232_TRANSMIT_FULL)
;
FPGA(RS232_DATA) = c;
}
main()
{
int i;
char c = 'A';
SetBitDirection(44,0);
SetBitDirection(45,1);
FPGA(RS232_BAUD_REG) = RS232_BAUD_9600;
for (i=0; i<4; i++)
{
SendChar(c);
printf("Sent: %c\n", c++);
printf("Received %x\n", ReceiveChar());
}
}
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
>
> Most of the IO do not have pull down resistors. Pull down resistors would interfere with the open-collector output mode. There are 16 IO with strong 150ohm pull downs. The first 8 on JP4 and JP6. The Inputs are MosFETS which are very high impedance (multi-meg ohms). To be used as an input they must be driven high and low by something. If left undriven they will float to any level and can be influenced by the slightest signal such as the parasitic capacitance to a nearby signal.
>
> Regards
> TK
>
>
>
> ________________________________
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, June 14, 2012 8:02 AM
> Subject: [DynoMotion] Re: RS232 Not Working?
>
>
> Â
> Tom,
>
> Why are the inputs so sensitive? I've noticed many times that if I change one input while watching the Digital I/O dialog, it is not unusual to see several inputs flash briefly to a different state. I thought most of the inputs had pull-downs on them?
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ray,
> >
> > You cannot leave the LVTTL UART input floating and expect a predicable result.
> > You might connect the input to the output as a loopback for testing.
> >
> > You can check on the Digital IO screen how the IO is configured.
> >
> > Regards
> > TK
> >
> >
> >
> > ________________________________
> > From: himykabibble <jagboy@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Wednesday, June 13, 2012 11:56 PM
> > Subject: [DynoMotion] Re: RS232 Not Working?
> >
> >
> > ÃÂ
> > FWIW - I tried the poll-driven code from the RS232 web page, and got exactly the same result....
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> > >
> > > Tom,
> > >
> > > I've got my pendant firmware mostly up, and just tried to use the KFlop RS232 for the first time. I'm using the BufferedRS232 example code, with only the BAUD rate changed to 9600, a while(1) loop added around the existing while loop and RS232_GetChar call, and a printf to print the received character. Trouble is, it spews characters continuously, even though there is nothing even connected to the RS232 data pins! Are you sure this works?
> > >
> > > Does the EnableRS232Cmds call set the pin directions, or do I need to do that?
> > >
> > > Regards,
> > > Ray L.
> > >
> >
>
|
|
Group: DynoMotion |
Message: 5213 |
From: Tom Kerekes |
Date: 6/14/2012 |
Subject: Re: RS232 Not Working? |
Hi Ray,
I think the RS232 needs to be enabled with:
FPGA(KAN_TRIG_REG) = 2; // enable RS232 working (if Kanalog, it will be changed to 3)
It would be better if you used the newer buffered functions which do the buffering for you, enable this for you, and allow higher baud rates.
Regards
TK.
Group: DynoMotion |
Message: 5220 |
From: himykabibble |
Date: 6/14/2012 |
Subject: Re: RS232 Not Working? |
Tom,
See below....
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
> Â
> I think the RS232 needs to be enabled with:
> Â FPGA(KAN_TRIG_REG) = 2;
Wouldn't that be a useful detail to include in the example code? No offense, but this is one of the things that has made KFlop very frustrating at times to work with - the example code often simply does not work as written, and/or contains extraneous instructions that have nothing to do with the function that is the heart of the example, and/or misleading comments.
> It would be better if you used the newer buffered functions which do > the buffering for you, enable this for you, and allow higher baud > > rates.
Well, that's exactly where I started, but that didn't work either, no doubt for the same reason.
> Â
> Â
> Regards
> TK.Â
>
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, June 14, 2012 12:23 PM
> Subject: [DynoMotion] Re: RS232 Not Working?
>
>
> Â
> Tom,
>
> Still no dice. I hard-wired JP7-5 to JP7-6. No other I/Os have anything connected. I run the following program, and it prints the correct values for the sent data, and always zero for the received data. I'm stuck....
>
> Regards,
> Ray L.
>
> #include "KMotionDef.h"
>
> void ReceiveChar()
> {
> // wait for data in buffer
> while ((FPGA(RS232_STATUS) & RS232_DATA_READY)==0)
> ;
> return FPGA(RS232_DATA);
> }
>
> void SendChar(char c)
> {
> while (FPGA(RS232_STATUS) & RS232_TRANSMIT_FULL)
> ;
> FPGA(RS232_DATA) = c;
> }
>
> main()
> {
> int i;
> char c = 'A';
>
> SetBitDirection(44,0);
> SetBitDirection(45,1);
> FPGA(RS232_BAUD_REG) = RS232_BAUD_9600;
> for (i=0; i<4; i++)
> {
> SendChar(c);
> printf("Sent: %c\n", c++);
> printf("Received %x\n", ReceiveChar());
> }
> }
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ray,
> >
> > Most of the IO do not have pull down resistors.ÃÂ Pull down resistors would interfere with the open-collector output mode.ÃÂ There are 16 IO with strong 150ohm pull downs. The first 8 on JP4 and JP6.ÃÂ The Inputs are MosFETS which are very high impedance (multi-meg ohms).ÃÂ To be used as an input they must be driven high and low by something.ÃÂ If left undriven they will float to any level and can be influenced by the slightest signal such as the parasitic capacitance to a nearby signal.
> >
> > Regards
> > TK
> >
> >
> >
> > ________________________________
> > From: himykabibble <jagboy@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Thursday, June 14, 2012 8:02 AM
> > Subject: [DynoMotion] Re: RS232 Not Working?
> >
> >
> > ÃÂ
> > Tom,
> >
> > Why are the inputs so sensitive? I've noticed many times that if I change one input while watching the Digital I/O dialog, it is not unusual to see several inputs flash briefly to a different state. I thought most of the inputs had pull-downs on them?
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Ray,
> > >
> > > You cannot leave the LVTTL UART input floating and expect a predicable result.
> > > You might connect the input to the output as a loopback for testing.
> > >
> > > You can check on the Digital IO screen how the IO is configured.
> > >
> > > Regards
> > > TK
> > >
> > >
> > >
> > > ________________________________
> > > From: himykabibble <jagboy@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Wednesday, June 13, 2012 11:56 PM
> > > Subject: [DynoMotion] Re: RS232 Not Working?
> > >
> > >
> > > ÃâÃÂ
> > > FWIW - I tried the poll-driven code from the RS232 web page, and got exactly the same result....
> > >
> > > Regards,
> > > Ray L.
> > >
> > > --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> > > >
> > > > Tom,
> > > >
> > > > I've got my pendant firmware mostly up, and just tried to use the KFlop RS232 for the first time. I'm using the BufferedRS232 example code, with only the BAUD rate changed to 9600, a while(1) loop added around the existing while loop and RS232_GetChar call, and a printf to print the received character. Trouble is, it spews characters continuously, even though there is nothing even connected to the RS232 data pins! Are you sure this works?
> > > >
> > > > Does the EnableRS232Cmds call set the pin directions, or do I need to do that?
> > > >
> > > > Regards,
> > > > Ray L.
> > > >
> > >
> >
>
>
>
>
> // enable RS232 working (if Kanalog, it will be changed to 3)It would be better if you used the newer buffered functions which do the buffering for you, enable this for you, and allow higher baud rates.
>
|
|
Group: DynoMotion |
Message: 5221 |
From: Tom Kerekes |
Date: 6/14/2012 |
Subject: Re: RS232 Not Working? |
Hi Ray,
I thought when you were trying the recommended buffered example your input was floating? The new FPGA setting is automatically handled in the buffered routines that should not have been the problem.
Regards
TK
Group: DynoMotion |
Message: 5222 |
From: himykabibble |
Date: 6/14/2012 |
Subject: Re: RS232 Not Working? |
Tom,
Nope, I tried it in loopback as well.
BTW - What signal polarity is the UART expecting? Should a received start bit be a rising or falling edge? I assume Tx is the same? I believe RS232 transceivers are inverting, no?
I have loopback working on both the pendant and the KFlop, but they won't talk to each other when connected together.
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
> Â
> I thought when you were trying the recommended buffered example your input was floating? The new FPGA setting is automatically handled in the buffered routines that should not have been the problem.
> Â
> Regards
> TK
>
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, June 14, 2012 5:31 PM
> Subject: [DynoMotion] Re: RS232 Not Working?
>
>
> Â
> Tom,
>
> See below....
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ray,
> > ÃÂ
> > I think the RS232 needs to be enabled with:
> > ÃÂ FPGA(KAN_TRIG_REG) = 2;
>
> Wouldn't that be a useful detail to include in the example code? No offense, but this is one of the things that has made KFlop very frustrating at times to work with - the example code often simply does not work as written, and/or contains extraneous instructions that have nothing to do with the function that is the heart of the example, and/or misleading comments.
>
> > It would be better if you used the newer buffered functions which do > the buffering for you, enable this for you, and allow higher baud > > rates.
>
> Well, that's exactly where I started, but that didn't work either, no doubt for the same reason.
>
> > ÃÂ
> > ÃÂ
> > Regards
> > TK.ÃÂ
> >
> > From: himykabibble <jagboy@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Thursday, June 14, 2012 12:23 PM
> > Subject: [DynoMotion] Re: RS232 Not Working?
> >
> >
> > ÃÂ
> > Tom,
> >
> > Still no dice. I hard-wired JP7-5 to JP7-6. No other I/Os have anything connected. I run the following program, and it prints the correct values for the sent data, and always zero for the received data. I'm stuck....
> >
> > Regards,
> > Ray L.
> >
> > #include "KMotionDef.h"
> >
> > void ReceiveChar()
> > {
> > // wait for data in buffer
> > while ((FPGA(RS232_STATUS) & RS232_DATA_READY)==0)
> > ;
> > return FPGA(RS232_DATA);
> > }
> >
> > void SendChar(char c)
> > {
> > while (FPGA(RS232_STATUS) & RS232_TRANSMIT_FULL)
> > ;
> > FPGA(RS232_DATA) = c;
> > }
> >
> > main()
> > {
> > int i;
> > char c = 'A';
> >
> > SetBitDirection(44,0);
> > SetBitDirection(45,1);
> > FPGA(RS232_BAUD_REG) = RS232_BAUD_9600;
> > for (i=0; i<4; i++)
> > {
> > SendChar(c);
> > printf("Sent: %c\n", c++);
> > printf("Received %x\n", ReceiveChar());
> > }
> > }
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Ray,
> > >
> > > Most of the IO do not have pull down resistors.ÃâàPull down resistors would interfere with the open-collector output mode.ÃâàThere are 16 IO with strong 150ohm pull downs. The first 8 on JP4 and JP6.ÃâàThe Inputs are MosFETS which are very high impedance (multi-meg ohms).ÃâàTo be used as an input they must be driven high and low by something.ÃâàIf left undriven they will float to any level and can be influenced by the slightest signal such as the parasitic capacitance to a nearby signal.
> > >
> > > Regards
> > > TK
> > >
> > >
> > >
> > > ________________________________
> > > From: himykabibble <jagboy@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Thursday, June 14, 2012 8:02 AM
> > > Subject: [DynoMotion] Re: RS232 Not Working?
> > >
> > >
> > > ÃâÃÂ
> > > Tom,
> > >
> > > Why are the inputs so sensitive? I've noticed many times that if I change one input while watching the Digital I/O dialog, it is not unusual to see several inputs flash briefly to a different state. I thought most of the inputs had pull-downs on them?
> > >
> > > Regards,
> > > Ray L.
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi Ray,
> > > >
> > > > You cannot leave the LVTTL UART input floating and expect a predicable result.
> > > > You might connect the input to the output as a loopback for testing.
> > > >
> > > > You can check on the Digital IO screen how the IO is configured.
> > > >
> > > > Regards
> > > > TK
> > > >
> > > >
> > > >
> > > > ________________________________
> > > > From: himykabibble <jagboy@>
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Wednesday, June 13, 2012 11:56 PM
> > > > Subject: [DynoMotion] Re: RS232 Not Working?
> > > >
> > > >
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > FWIW - I tried the poll-driven code from the RS232 web page, and got exactly the same result....
> > > >
> > > > Regards,
> > > > Ray L.
> > > >
> > > > --- In DynoMotion@yahoogroups.com, "himykabibble" <jagboy@> wrote:
> > > > >
> > > > > Tom,
> > > > >
> > > > > I've got my pendant firmware mostly up, and just tried to use the KFlop RS232 for the first time. I'm using the BufferedRS232 example code, with only the BAUD rate changed to 9600, a while(1) loop added around the existing while loop and RS232_GetChar call, and a printf to print the received character. Trouble is, it spews characters continuously, even though there is nothing even connected to the RS232 data pins! Are you sure this works?
> > > > >
> > > > > Does the EnableRS232Cmds call set the pin directions, or do I need to do that?
> > > > >
> > > > > Regards,
> > > > > Ray L.
> > > > >
> > > >
> > >
> >
> >
> >
> >
> > // enable RS232 working (if Kanalog, it will be changed to 3)It would be better if you used the newer buffered functions which do the buffering for you, enable this for you, and allow higher baud rates.
> >
>
|
|
Group: DynoMotion |
Message: 5223 |
From: Tom Kerekes |
Date: 6/14/2012 |
Subject: Re: RS232 Not Working? |
Hi Ray,
I believe RS232 tranceivers are inverting. The simplest thing to do if you have loopback working would be to look at the digital IO screen when not transmitting and observe the level. Yes Transmit and Receive are the same polarity otherwise loopback wouldn't work.
So you tried it in loopback mode and it didn't work, but now it works??
Regards
TK
Group: DynoMotion |
Message: 5224 |
From: himykabibble |
Date: 6/15/2012 |
Subject: Re: RS232 Not Working? |
Tom,
I've got the two boards talking now. However, the "buffered" I/O example contains only read and write functions, which are both blocking functions. Is there no non-blocking function to determine IF there is a character waiting? If not, there really needs to be, to make it usable.
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
> Â
> I believe RS232 tranceivers are inverting. The simplest thing to do if you have loopback working would be to look at the digital IO screen when not transmitting and observe the level. Yes Transmit and Receive are the same polarity otherwise loopback wouldn't work.
> Â
> So you tried it in loopback mode and it didn't work, but now it works??
> Â
> Regards
> TK
> Â
> Â
>
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, June 14, 2012 6:41 PM
> Subject: [DynoMotion] Re: RS232 Not Working?
>
>
> Â
> Tom,
>
> Nope, I tried it in loopback as well.
>
> BTW - What signal polarity is the UART expecting? Should a received start bit be a rising or falling edge? I assume Tx is the same? I believe RS232 transceivers are inverting, no?
>
> I have loopback working on both the pendant and the KFlop, but they won't talk to each other when connected together.
>
> Regards,
> Ray L.
>
> --- In mailto:DynoMotion%40yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ray,
> > ÃÂ
> > I thought when you were trying the recommended buffered example your input was floating?ÃÂ The new FPGA setting is automatically handled in the buffered routines that should not have been the problem.
> > ÃÂ
> > Regards
> > TK
> >
> > From: himykabibble <jagboy@>
> > To: mailto:DynoMotion%40yahoogroups.com
> > Sent: Thursday, June 14, 2012 5:31 PM
> > Subject: [DynoMotion] Re: RS232 Not Working?
> >
> >
> > ÃÂ
> > Tom,
> >
> > See below....
> >
> > --- In mailto:DynoMotion%40yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Ray,
> > > ÃâÃÂ
> > > I think the RS232 needs to be enabled with:
> > > ÃâàFPGA(KAN_TRIG_REG) = 2;
> >
> > Wouldn't that be a useful detail to include in the example code? No offense, but this is one of the things that has made KFlop very frustrating at times to work with - the example code often simply does not work as written, and/or contains extraneous instructions that have nothing to do with the function that is the heart of the example, and/or misleading comments.
> >
> > > It would be better if you used the newer buffered functions which do > the buffering for you, enable this for you, and allow higher baud > > rates.
> >
> > Well, that's exactly where I started, but that didn't work either, no doubt for the same reason.
> >
> > > ÃâÃÂ
> > > ÃâÃÂ
> > > Regards
> > > TK.ÃâÃÂ
> > >
> > > From: himykabibble <jagboy@>
> > > To: mailto:DynoMotion%40yahoogroups.com
> > > Sent: Thursday, June 14, 2012 12:23 PM
> > > Subject: [DynoMotion] Re: RS232 Not Working?
> > >
> > >
> > > ÃâÃÂ
> > > Tom,
> > >
> > > Still no dice. I hard-wired JP7-5 to JP7-6. No other I/Os have anything connected. I run the following program, and it prints the correct values for the sent data, and always zero for the received data. I'm stuck....
> > >
> > > Regards,
> > > Ray L.
> > >
> > > #include "KMotionDef.h"
> > >
> > > void ReceiveChar()
> > > {
> > > // wait for data in buffer
> > > while ((FPGA(RS232_STATUS) & RS232_DATA_READY)==0)
> > > ;
> > > return FPGA(RS232_DATA);
> > > }
> > >
> > > void SendChar(char c)
> > > {
> > > while (FPGA(RS232_STATUS) & RS232_TRANSMIT_FULL)
> > > ;
> > > FPGA(RS232_DATA) = c;
> > > }
> > >
> > > main()
> > > {
> > > int i;
> > > char c = 'A';
> > >
> > > SetBitDirection(44,0);
> > > SetBitDirection(45,1);
> > > FPGA(RS232_BAUD_REG) = RS232_BAUD_9600;
> > > for (i=0; i<4; i++)
> > > {
> > > SendChar(c);
> > > printf("Sent: %c\n", c++);
> > > printf("Received %x\n", ReceiveChar());
> > > }
> > > }
> > >
> > > --- In mailto:DynoMotion%40yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi Ray,
> > > >
> > > > Most of the IO do not have pull down resistors.ÃÆ'ââ¬Å¡ÃâàPull down resistors would interfere with the open-collector output mode.ÃÆ'ââ¬Å¡ÃâàThere are 16 IO with strong 150ohm pull downs. The first 8 on JP4 and JP6.ÃÆ'ââ¬Å¡ÃâàThe Inputs are MosFETS which are very high impedance (multi-meg ohms).ÃÆ'ââ¬Å¡ÃâàTo be used as an input they must be driven high and low by something.ÃÆ'ââ¬Å¡ÃâàIf left undriven they will float to any level and can be influenced by the slightest signal such as the parasitic capacitance to a nearby signal.
> > > >
> > > > Regards
> > > > TK
> > > >
> > > >
> > > >
> > > > ________________________________
> > > > From: himykabibble <jagboy@>
> > > > To: mailto:DynoMotion%40yahoogroups.com
> > > > Sent: Thursday, June 14, 2012 8:02 AM
> > > > Subject: [DynoMotion] Re: RS232 Not Working?
> > > >
> > > >
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > Tom,
> > > >
> > > > Why are the inputs so sensitive? I've noticed many times that if I change one input while watching the Digital I/O dialog, it is not unusual to see several inputs flash briefly to a different state. I thought most of the inputs had pull-downs on them?
> > > >
> > > > Regards,
> > > > Ray L.
> > > >
> > > > --- In mailto:DynoMotion%40yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi Ray,
> > > > >
> > > > > You cannot leave the LVTTL UART input floating and expect a predicable result.
> > > > > You might connect the input to the output as a loopback for testing.
> > > > >
> > > > > You can check on the Digital IO screen how the IO is configured.
> > > > >
> > > > > Regards
> > > > > TK
> > > > >
> > > > >
> > > > >
> > > > > ________________________________
> > > > > From: himykabibble <jagboy@>
> > > > > To: mailto:DynoMotion%40yahoogroups.com
> > > > > Sent: Wednesday, June 13, 2012 11:56 PM
> > > > > Subject: [DynoMotion] Re: RS232 Not Working?
> > > > >
> > > > >
> > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > FWIW - I tried the poll-driven code from the RS232 web page, and got exactly the same result....
> > > > >
> > > > > Regards,
> > > > > Ray L.
> > > > >
> > > > > --- In mailto:DynoMotion%40yahoogroups.com, "himykabibble" <jagboy@> wrote:
> > > > > >
> > > > > > Tom,
> > > > > >
> > > > > > I've got my pendant firmware mostly up, and just tried to use the KFlop RS232 for the first time. I'm using the BufferedRS232 example code, with only the BAUD rate changed to 9600, a while(1) loop added around the existing while loop and RS232_GetChar call, and a printf to print the received character. Trouble is, it spews characters continuously, even though there is nothing even connected to the RS232 data pins! Are you sure this works?
> > > > > >
> > > > > > Does the EnableRS232Cmds call set the pin directions, or do I need to do that?
> > > > > >
> > > > > > Regards,
> > > > > > Ray L.
> > > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > >
> > > // enable RS232 working (if Kanalog, it will be changed to 3)It would be better if you used the newer buffered functions which do the buffering for you, enable this for you, and allow higher baud rates.
> > >
> >
>
|
|
Group: DynoMotion |
Message: 5226 |
From: Tom Kerekes |
Date: 6/15/2012 |
Subject: Re: RS232 Not Working? |
Hi Ray,
Great. The Buffered example shows how this line can be used to check if there is data in the Receive Buffer.
while (pRS232RecIn == pRS232RecOut); // wait for data in buffer
Regards
TK
Group: DynoMotion |
Message: 5229 |
From: himykabibble |
Date: 6/15/2012 |
Subject: Re: RS232 Not Working? |
Tom,
I dunno how I missed that.... Is there any reason I can't, or shouldn't, flush the buffer by simply setting the two pointers to the same value?
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
> Â
> Great. The Buffered example shows how this line can be used to check if there is data in the Receive Buffer.
> Â
> Â while (pRS232RecIn == pRS232RecOut); // wait for data in buffer
>
> Regards
> TK
> Â
> Â
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Friday, June 15, 2012 3:52 PM
> Subject: [DynoMotion] Re: RS232 Not Working?
>
>
> Â
> Tom,
>
> I've got the two boards talking now. However, the "buffered" I/O example contains only read and write functions, which are both blocking functions. Is there no non-blocking function to determine IF there is a character waiting? If not, there really needs to be, to make it usable.
>
> Regards,
> Ray L.
>
> --- In mailto:DynoMotion%40yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Ray,
> > ÃÂ
> > I believe RS232 tranceivers are inverting.ÃÂ The simplest thing to do if you have loopback working would be to look at the digital IO screen when not transmitting and observe the level.ÃÂ Yes Transmit and Receive are the same polarity otherwise loopback wouldn't work.
> > ÃÂ
> > So you tried it in loopback mode and it didn't work, but now it works??
> > ÃÂ
> > Regards
> > TK
> > ÃÂ
> > ÃÂ
> >
> > From: himykabibble <jagboy@>
> > To: mailto:DynoMotion%40yahoogroups.com
> > Sent: Thursday, June 14, 2012 6:41 PM
> > Subject: [DynoMotion] Re: RS232 Not Working?
> >
> >
> > ÃÂ
> > Tom,
> >
> > Nope, I tried it in loopback as well.
> >
> > BTW - What signal polarity is the UART expecting? Should a received start bit be a rising or falling edge? I assume Tx is the same? I believe RS232 transceivers are inverting, no?
> >
> > I have loopback working on both the pendant and the KFlop, but they won't talk to each other when connected together.
> >
> > Regards,
> > Ray L.
> >
> > --- In mailto:DynoMotion%40yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Ray,
> > > ÃâÃÂ
> > > I thought when you were trying the recommended buffered example your input was floating?ÃâàThe new FPGA setting is automatically handled in the buffered routines that should not have been the problem.
> > > ÃâÃÂ
> > > Regards
> > > TK
> > >
> > > From: himykabibble <jagboy@>
> > > To: mailto:DynoMotion%40yahoogroups.com
> > > Sent: Thursday, June 14, 2012 5:31 PM
> > > Subject: [DynoMotion] Re: RS232 Not Working?
> > >
> > >
> > > ÃâÃÂ
> > > Tom,
> > >
> > > See below....
> > >
> > > --- In mailto:DynoMotion%40yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi Ray,
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > I think the RS232 needs to be enabled with:
> > > > ÃÆ'ââ¬Å¡ÃâàFPGA(KAN_TRIG_REG) = 2;
> > >
> > > Wouldn't that be a useful detail to include in the example code? No offense, but this is one of the things that has made KFlop very frustrating at times to work with - the example code often simply does not work as written, and/or contains extraneous instructions that have nothing to do with the function that is the heart of the example, and/or misleading comments.
> > >
> > > > It would be better if you used the newer buffered functions which do > the buffering for you, enable this for you, and allow higher baud > > rates.
> > >
> > > Well, that's exactly where I started, but that didn't work either, no doubt for the same reason.
> > >
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > Regards
> > > > TK.ÃÆ'ââ¬Å¡ÃâÃÂ
> > > >
> > > > From: himykabibble <jagboy@>
> > > > To: mailto:DynoMotion%40yahoogroups.com
> > > > Sent: Thursday, June 14, 2012 12:23 PM
> > > > Subject: [DynoMotion] Re: RS232 Not Working?
> > > >
> > > >
> > > > ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > Tom,
> > > >
> > > > Still no dice. I hard-wired JP7-5 to JP7-6. No other I/Os have anything connected. I run the following program, and it prints the correct values for the sent data, and always zero for the received data. I'm stuck....
> > > >
> > > > Regards,
> > > > Ray L.
> > > >
> > > > #include "KMotionDef.h"
> > > >
> > > > void ReceiveChar()
> > > > {
> > > > // wait for data in buffer
> > > > while ((FPGA(RS232_STATUS) & RS232_DATA_READY)==0)
> > > > ;
> > > > return FPGA(RS232_DATA);
> > > > }
> > > >
> > > > void SendChar(char c)
> > > > {
> > > > while (FPGA(RS232_STATUS) & RS232_TRANSMIT_FULL)
> > > > ;
> > > > FPGA(RS232_DATA) = c;
> > > > }
> > > >
> > > > main()
> > > > {
> > > > int i;
> > > > char c = 'A';
> > > >
> > > > SetBitDirection(44,0);
> > > > SetBitDirection(45,1);
> > > > FPGA(RS232_BAUD_REG) = RS232_BAUD_9600;
> > > > for (i=0; i<4; i++)
> > > > {
> > > > SendChar(c);
> > > > printf("Sent: %c\n", c++);
> > > > printf("Received %x\n", ReceiveChar());
> > > > }
> > > > }
> > > >
> > > > --- In mailto:DynoMotion%40yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > >
> > > > > Hi Ray,
> > > > >
> > > > > Most of the IO do not have pull down resistors.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàPull down resistors would interfere with the open-collector output mode.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThere are 16 IO with strong 150ohm pull downs. The first 8 on JP4 and JP6.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàThe Inputs are MosFETS which are very high impedance (multi-meg ohms).ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàTo be used as an input they must be driven high and low by something.ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâàIf left undriven they will float to any level and can be influenced by the slightest signal such as the parasitic capacitance to a nearby signal.
> > > > >
> > > > > Regards
> > > > > TK
> > > > >
> > > > >
> > > > >
> > > > > ________________________________
> > > > > From: himykabibble <jagboy@>
> > > > > To: mailto:DynoMotion%40yahoogroups.com
> > > > > Sent: Thursday, June 14, 2012 8:02 AM
> > > > > Subject: [DynoMotion] Re: RS232 Not Working?
> > > > >
> > > > >
> > > > > ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > Tom,
> > > > >
> > > > > Why are the inputs so sensitive? I've noticed many times that if I change one input while watching the Digital I/O dialog, it is not unusual to see several inputs flash briefly to a different state. I thought most of the inputs had pull-downs on them?
> > > > >
> > > > > Regards,
> > > > > Ray L.
> > > > >
> > > > > --- In mailto:DynoMotion%40yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > > > >
> > > > > > Hi Ray,
> > > > > >
> > > > > > You cannot leave the LVTTL UART input floating and expect a predicable result.
> > > > > > You might connect the input to the output as a loopback for testing.
> > > > > >
> > > > > > You can check on the Digital IO screen how the IO is configured.
> > > > > >
> > > > > > Regards
> > > > > > TK
> > > > > >
> > > > > >
> > > > > >
> > > > > > ________________________________
> > > > > > From: himykabibble <jagboy@>
> > > > > > To: mailto:DynoMotion%40yahoogroups.com
> > > > > > Sent: Wednesday, June 13, 2012 11:56 PM
> > > > > > Subject: [DynoMotion] Re: RS232 Not Working?
> > > > > >
> > > > > >
> > > > > > ÃÆ'Ã'Ãâ 'ÃÆ'ââââ¬Å¡Ã¬Ãâ¦Ã¡ÃÆ'Ã'âââ¬Ã
¡ÃÆ'ââ¬Å¡ÃâÃÂ
> > > > > > FWIW - I tried the poll-driven code from the RS232 web page, and got exactly the same result....
> > > > > >
> > > > > > Regards,
> > > > > > Ray L.
> > > > > >
> > > > > > --- In mailto:DynoMotion%40yahoogroups.com, "himykabibble" <jagboy@> wrote:
> > > > > > >
> > > > > > > Tom,
> > > > > > >
> > > > > > > I've got my pendant firmware mostly up, and just tried to use the KFlop RS232 for the first time. I'm using the BufferedRS232 example code, with only the BAUD rate changed to 9600, a while(1) loop added around the existing while loop and RS232_GetChar call, and a printf to print the received character. Trouble is, it spews characters continuously, even though there is nothing even connected to the RS232 data pins! Are you sure this works?
> > > > > > >
> > > > > > > Does the EnableRS232Cmds call set the pin directions, or do I need to do that?
> > > > > > >
> > > > > > > Regards,
> > > > > > > Ray L.
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > > // enable RS232 working (if Kanalog, it will be changed to 3)It would be better if you used the newer buffered functions which do the buffering for you, enable this for you, and allow higher baud rates.
> > > >
> > >
> >
>
|
|
Group: DynoMotion |
Message: 5230 |
From: Tom Kerekes |
Date: 6/16/2012 |
Subject: Re: RS232 Not Working? |
Hi Ray,
That should work.
Regards
TK
| | | | | | | | | | | | | |